package com.archermind.style.bean;

import com.archermind.style.pojo.ElementEnum;
import com.feng.fengDUtil.dao.annotation.Enum;
import com.feng.fengDUtil.dao.annotation.Id;
import com.feng.fengDUtil.dao.annotation.Table;
import org.springframework.util.StringUtils;

@Table("dict_color")
public class DictColor {
    @Id
    private Integer id;
    private Integer instanceId;
    @Enum
    private ElementEnum element;//样

    private String name;//名称
    private String color;//颜色
    private String transparent;//透时度

    public String getRgbw(){
        if(StringUtils.isEmpty(transparent)){
            return this.color;
        }
        return color+transparent;
    }

    public DictColor() {
    }

    public DictColor(Integer instanceId, ElementEnum element, String name, String color, String transparent) {
        this.instanceId = instanceId;
        this.element = element;
        this.name = name;
        this.color = color;
        this.transparent = transparent;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public ElementEnum getElement() {
        return element;
    }

    public void setElement(ElementEnum element) {
        this.element = element;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getTransparent() {
        return transparent;
    }

    public void setTransparent(String transparent) {
        this.transparent = transparent;
    }

    public Integer getInstanceId() {
        return instanceId;
    }

    public void setInstanceId(Integer instanceId) {
        this.instanceId = instanceId;
    }
}
